package com.jstyle.beatecg.base;

import android.app.ProgressDialog;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.widget.Toast;

/**
 * Created by Administrator on 2017/3/22.
 */

public class BaseFragment extends Fragment {

    private ProgressDialog progressDialog;

    protected void startActivity(Class activity){
        Intent intent =new Intent(getActivity(),activity);
        startActivity(intent);
    }
    protected void showToast(String text){
        Toast.makeText(getActivity(),text, Toast.LENGTH_SHORT).show();
    }
    protected void showProgressDialog(String message){

        if(progressDialog==null){
            progressDialog=new ProgressDialog(getActivity());
        }
        progressDialog.setMessage(message);
        progressDialog.show();
    }
    protected  void disMissProgressDialog(){
        if(progressDialog!=null&&progressDialog.isShowing()){
            progressDialog.dismiss();
        }
    }

    protected void shoot(){

    }

}
